#ifndef QCOMMONSTRUCT_H
#define QCOMMONSTRUCT_H


#include <QString>
#include <QVariant>
#include <QGradient>
#include <QPointF>
#include <QPen>

struct tagComboItem
{
    QString     m_text;
    QString     m_icon;
    QVariant    m_value;
    bool operator ==(const tagComboItem &item)
    {
        return (m_value==item.m_value);
    }
};

typedef QList<tagComboItem> ComboItems;
Q_DECLARE_METATYPE(ComboItems)


class tagMemeryValueInfo
{
public:
    QString     m_propertyName;
    QString     m_uuid;
    QString     m_property_to_value_script;
    QString     m_value_to_property_script;
    bool operator ==(const tagMemeryValueInfo &info)
    {
        return (info.m_propertyName==m_propertyName
                && info.m_uuid==m_uuid
                && info.m_property_to_value_script==m_property_to_value_script
                && info.m_value_to_property_script==m_value_to_property_script);
    }
};
typedef QList<tagMemeryValueInfo> MemeryValueItems;
Q_DECLARE_METATYPE(MemeryValueItems)

struct tagComboBox
{
    QString     m_text;
    QString     m_icon;

    bool operator ==(const tagComboBox &item)
    {
        return (m_text==item.m_text && m_icon==item.m_icon);
    }
};

typedef QList<tagComboBox> ComboBoxItems;
Q_DECLARE_METATYPE(ComboBoxItems)

Q_DECLARE_METATYPE(QGradient)

typedef QList<QPointF>   QPointFs;
Q_DECLARE_METATYPE(QPointFs)

struct tagPenInfo
{
    QGradient       m_color;
    int             m_width;
    Qt::PenStyle    m_pen_style;
    Qt::PenCapStyle m_pen_cap_style;
    Qt::PenJoinStyle m_pen_join_style;

    bool operator ==(const tagPenInfo &info)
    {
        return (m_width==info.m_width &&
                m_pen_style==info.m_pen_style &&
                m_pen_cap_style==info.m_pen_cap_style &&
                m_pen_join_style==info.m_pen_join_style &&
                m_color==info.m_color);
    }
};
Q_DECLARE_METATYPE(tagPenInfo)


struct tagNeedleInfo
{
    QGradient                   m_color;
    QGradient                   m_knob_color;
    bool                        m_knob_visible;
    double                      m_width;
    int                         m_style;

    tagNeedleInfo()
    {
        m_knob_color=m_color=QLinearGradient();
        m_width=10;
        m_style=0;
        m_knob_visible=true;
    }

    bool operator ==(const tagNeedleInfo &info)
    {
        return (info.m_color==m_color
                && info.m_width==m_width
                && info.m_style==m_style
                && info.m_knob_color==m_knob_color
                && info.m_knob_visible==m_knob_visible);
    }

    bool operator !=(const tagNeedleInfo &info)
    {
        return !(*this==info);
    }
};
Q_DECLARE_METATYPE(tagNeedleInfo)


#endif // QCOMMONSTRUCT_H
